ChannelListViewModel

open class ChannelListViewModel : BaseViewModel, OnPagedDataLoader<T>

ViewModel preparing and managing data related with the list of channels since 3.0.0

Constructors

Link copied to clipboard
open fun ChannelListViewModel(@Nullable query: GroupChannelListQuery)
Constructor

Functions

Link copied to clipboard
open fun authenticate(@NonNull handler: AuthenticateHandler)
Tries to connect Sendbird Server.
Link copied to clipboard
protected open fun createGroupChannelListQuery(): GroupChannelListQuery
Creates group channel list query.
Link copied to clipboard
open fun getChannelList(): LiveData<List<GroupChannel>>
Live data that can be observed for a list of channels.
Link copied to clipboard
open fun hasNext(): Boolean
Determine whether the data on the next page exists.
Link copied to clipboard
open fun hasPrevious(): Boolean
Returns false as the channel list do not support to load for the previous by default.
Link copied to clipboard
open fun leaveChannel(@NonNull channel: GroupChannel, @Nullable handler: OnCompleteHandler)
Leaves the targeted channel.
Link copied to clipboard
open fun loadInitial()
Requests the list of GroupChannels for the first time.
Link copied to clipboard
open fun loadNext(): List<GroupChannel>
Requests the list of GroupChannels.
Link copied to clipboard
open fun loadPrevious(): List<GroupChannel>
Returns the empty list as the channel list do not support to load for the previous by default.
Link copied to clipboard
protected open fun onCleared()
Link copied to clipboard
open fun setPushNotification(    @NonNull channel: GroupChannel,     enable: Boolean,     @Nullable handler: OnCompleteHandler)
Sets push notification settings of this channel.